﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace ST.Buz.Base.Entity
{
	/// <summary>
	/// 用户角色比较
	/// </summary>
	public class Sys_Compare_UserRole : IEqualityComparer<Sys_UserRole>
	{
		public bool Equals(Sys_UserRole x, Sys_UserRole y)
		{
			if (x == null && y == null)
			{
				return true;
			}
			else if (x == null || y == null)
			{
				return false;
			}
			else
			{
				return x.RoleID == y.RoleID;
			}
		}

		public int GetHashCode(Sys_UserRole obj)
		{
			if (obj == null)
			{
				return 0;
			}
			//return obj.GetHashCode();
			return obj.RoleID.GetHashCode();
			//return obj.ID.GetHashCode();
		}
	}
}
